<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 

    <style type="text/css">
.m{
	width: 100px;height: 100px;background: black;float: left;
}

    </style>
    <script type="text/javascript" src='jquery-1.9.1.min.js'></script>
</head>
<div class='div'></div>
<div class='div'></div>
<div class='div' id='div'></div>
<div class='dfiv'></div>
<span></span>
<body>
<script type="text/javascript">
//width show hide height css
function Jquery(obj){
	this.ele = obj.charAt(0);
	this.arr = [];
	switch(this.ele){
		case '.' :
		var all = document.getElementsByTagName('*');
		for(var i = 0;i < all.length;i++){
			if(all[i].className.indexOf(obj.substring(1))!=-1){
				this.arr.push(all[i]);
			}
		}
		break;
		case '#' :
		//alert(1);
		//#div
		//div
		this.arr.push(document.getElementById(obj.substring(1)));
		//console.log(this.arr);
		break;
		default:

		var all = document.getElementsByTagName(obj);
		for(var i = 0;i < all.length;i++){
			this.arr.push(all[i]);
		}
		break;
	}
};
Jquery.prototype = {
	'addClass':function(s){
		for(var i = 0;i < this.arr.length;i++){
			this.arr[i].className = s;
		}
	},
	'width':function(s){
		for(var i = 0;i < this.arr.length;i++){
			this.arr[i].style.width = /px$/.test(s)?s:s+='px';
		}
		
		//px 
		//for(var i = 0;i <)
	},
	'css':function(){
		
	}
}

function $(string){
	return new Jquery(string);
};


$('div').width(100);
//number string
//#
//.
//标签

</script>
</body>
</html>